//contact template: {$TEMPLATE} {literal}
var KONFIGURATOR_BEZUGSTOFFE_1 = {};
$.extend(KONFIGURATOR_BEZUGSTOFFE_1, KONFIGURATOR_BASE_BEZUGSTOFFE, {

	praefix: 'bezugstoffe_1',
	description: 'Bezugsstoff einfarbig',
	value: '',

  loadValue: function(id) {
  	var imgId = $('#gallery_bezugstoffe_front_thmb_'+id).parents('div.thmb');
  	this.onChooseThmb({currentTarget: imgId.get(0)});
{/literal}{if $FORM_ACTION == true}{literal}
  	this.onChange();
  },

  onChange: function() {
  	var img_folder = 'BEZUGSTOFFE';
  	var praefix_upper = this.praefix.toUpperCase();
    this.value = $('#gallery_'+this.praefix+' div[name=id-select]').html();
    var img_name = $('#gallery_'+this.praefix+' div[name=src-select]').html();
		$('.container_popup_layer .btn_close').click();

  	$('#thmb_'+praefix_upper+' a').attr({'href': window.KONFIGURATOR_IMGPATH_POPUP+img_folder+'/'+img_name});
  	$('#thmb_'+praefix_upper+' img').attr({'src': window.KONFIGURATOR_IMGPATH_THMB+img_folder+'/'+img_name});
  	$('#thmb_'+praefix_upper).show();
  	
  	$('#'+praefix_upper).val(this.value);
  	$('#'+praefix_upper).change();
  	
  	$('div[tmpl='+praefix_upper+'] span.name_option').html($('#gallery_'+this.praefix+' span[name=name-select]').html());
  }

{/literal}{else}{literal}
  }
{/literal}{/if}{literal}
	
});


$(document).ready(function() { 
	KONFIGURATOR_BEZUGSTOFFE_1.init(); 
	$(document).trigger('konfigurator_load', 'KONFIGURATOR_BEZUGSTOFFE_1');
});

{/literal}




